package common.peer;

import java.util.ArrayList;
import java.util.HashMap;

import common.peer.PeerAddress;

public class PeerData {
	
	private PeerAddress self;
	private ArrayList<PeerAddress> parents;
	private ArrayList<PeerAddress> children;
	private ArrayList<PeerAddress> tmanView;
	private ArrayList<PeerAddress> cyclonView;
	private ArrayList<PeerAddress> fingersList;
	private float tmanAge;
	private float cyclonAge;
	private float hopcount;
	private int sp;
	private HashMap<String, Integer> eventCounts;
	private int ps;
	
	public PeerData(PeerAddress self, ArrayList<PeerAddress> parents, ArrayList<PeerAddress> children, ArrayList<PeerAddress> cyclonView, ArrayList<PeerAddress> tmanView, float cyclonAge, float tmanAge, float hopcount)
	{
		this.self = self;
		this.parents = new ArrayList<PeerAddress>(parents);
		this.children = new ArrayList<PeerAddress>(children);
		this.tmanView = new ArrayList<PeerAddress>(tmanView);
		this.cyclonView = new ArrayList<PeerAddress>(cyclonView);
		this.tmanAge = tmanAge;
		this.cyclonAge = cyclonAge;
		this.hopcount = hopcount;
		
	}
	
	public void setParentSwitches(int ps)
	{
		this.ps = ps;
	}
	
	public int getParentSwitches()
	{
		return ps;
	}
	
	public void setEventCounts(HashMap<String, Integer> ecs)
	{
		//eventCounts = (HashMap<String, Integer>) ecs.clone();
		eventCounts = new HashMap<String, Integer>(ecs);
	}
	
	public HashMap<String, Integer> getEventCounts()
	{
		return eventCounts;
	}
	
	public void setFingersList(ArrayList<PeerAddress> fl)
	{
		fingersList = fl;
	}
	
	public void setSp(int sp)
	{
		this.sp = sp;
	}
	
	public int getSp()
	{
		return sp;
	}
	
	public ArrayList<PeerAddress> getFingersList()
	{
		return fingersList;
	}
	
	public float getHopcount()
	{
		return hopcount;
	}
	
	public PeerAddress getSelf()
	{
		return self;
	}
	
	public ArrayList<PeerAddress> getParents()
	{
		return parents;
	}
	
	public ArrayList<PeerAddress> getChildren()
	{
		return children;
	}
	
	public ArrayList<PeerAddress> getTView()
	{
		return tmanView;
	}
	
	public ArrayList<PeerAddress> getCView()
	{
		return cyclonView;
	}
	
	public float getTAge()
	{
		return tmanAge;
	}
	
	public float getCAge()
	{
		return cyclonAge;
	}

}
